#include "DataStorage.h"
#include "EEPROM.h"
#include <Arduino.h>
#include "log.h"

DataStorage::DataStorage(DataStorageBase* data_base):
    _data_base(data_base)
{

}
DataStorage::~DataStorage()
{

}
void DataStorage::begin()
{
    EEPROM.begin();
    //_data_base->make_default();
    if(!this->load()){
        _data_base->make_default();
        log::debug("make default:ok\r\n");
    }else{
        log::debug("read eeprom:ok\r\n");
    }
}